import subprocess


def exec_snmp(command, output_file_name):
    # subprocess.run(command, shell=True, stdout=open(output_file_name, 'w',encoding='utf-8'))
    with open(output_file_name, 'w') as f:
        subprocess.run(command, shell=False, stdout=f)


if __name__ == '__main__':
    device = "FW11"
    file_name = device + "_.txt"
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 192.168.13.3 1.3.6.1.2.1.4.24.4.1.5'
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 192.168.13.3 1.3.6.1.2.1.31.1.1.1.18'
    snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c Tontron@1169! 192.168.12.12 1.3.6.1.2.1.31.1.1.1.18'
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 10.0.10.2 1.3.6.1.2.1.31.1.1.1.18'
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 10.0.10.2 1.3.6.1.2.1.4.24.4.1.5
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 192.168.10.2 1.3.6.1.2.1.31.1.1.1.18'
    # snmp_command = f'./snmptool/snmpwalk.exe -v 2c -c public 172.16.10.2 1.3.6.1.2.1.4.24.4.1.5'
    exec_snmp(snmp_command, file_name)
